package utils

import (
	"dbManager/manager/config"
	"encoding/json"
	"github.com/BurntSushi/toml"
	"io/ioutil"
)

//todo 工具方法

func TomlDecode(path string, config config.Config) error {
	_, err := toml.DecodeFile(path, config)
	return err
}
func JsonDecode(path string, config config.Config) error {
	file, err := ioutil.ReadFile(path)
	if err != nil {
		return err
	}
	err = json.Unmarshal(file, &config)
	return err
}
